Skip to main content

revXMLRPC_AddParam

Type

command

Summary

Adds a single parameter to an XML-RPC document structure.

Syntax

revXMLRPC_AddParam <XMLRPCdocumentID>, <dataType>, <dataValue>

Description

Use the revXMLRPC_AddParam command to add a single parameter of a given type to an existing XML-RPC document.

To pass an array of data, you have to pass the type as well, in the following format:

    array[:elementType]

For example:

    local theArray
repeat with i = 1 to 10
put random(100) into theArray[i]
end repeat
revXMLRPC_AddParam theDocID, \"array:int\", theArray

If you do not specify an element type, the revXMLRPC_AddParam command assumes you're passing an array of strings.

If you need to add complex parameters (such as arrays of various types, or structs) you can specify a dataType of xml, and pass raw xml.

Parameters

NameTypeDescription

XMLRPCdocumentID

integer

The number returned by the revXMLRPC_CreateRequest when you created the XML-RPC request.

dataType

enum

The type of data contained in the dataValue parameter.

dataValue

string

The content of the data you want to add as a new parameter.

Examples

revXMLRPC_AddParam theRequest, "int", 55
revXMLRPC_AddParam theRequest, "base64", base64Encode(theBinaryData)
put "&lt;struct&gt;" & \
"&lt;member&gt;&lt;name&gt;left&lt;/name&gt;" & \
"&lt;value&gt;&lt;int&gt;10&lt;/int&gt;&lt;/value&gt;&lt;/member&gt;" & \
"&lt;member&gt;&lt;name&gt;top&lt;/name&gt;" & \
"&lt;value&gt;&lt;int&gt;50&lt;/int&gt;&lt;/value&gt;&lt;/member&gt;" & \
"&lt;member&gt;&lt;name&gt;right&lt;/name&gt;" & \
"&lt;value&gt;&lt;int&gt;390&lt;/int&gt;&lt;/value&gt;&lt;/member&gt;" & \
"&lt;member&gt;&lt;name&gt;bottom&lt;/name&gt;" & \
"&lt;value&gt;&lt;int&gt;240&lt;/int&gt;&lt;/value&gt;&lt;/member&gt;" & \
"&lt;/struct&gt;" into theStruct
revXMLRPC_AddParam theDocID, "xml", theStruct

glossary: Standalone Application Settings, standalone application, command, XML-RPC document, LiveCode custom library, XML-RPC

library: XML-RPC library

function: revXMLRPC_GetParamType, revXMLRPC_GetParam, result, revXMLRPC_GetParamCount, revXMLRPC_CreateRequest

Compatibility and Support

Introduced

LiveCode 2.5

OS

mac

windows

linux

ios

android

Platforms

desktop

server

mobile

Thank you for your feedback!

Was this page helpful?